/**
* +----------------------------------------------------------------------
* | 友得云客  - 开启房产营销新纪元
* +----------------------------------------------------------------------
* | Copyright (c) 2019~2023 优得（西安）信息科技有限公司版权所有
* +----------------------------------------------------------------------
* | Licensed 友得云客不是自由软件 未经允许不可移除相关版权
* +----------------------------------------------------------------------
* | Author: www.youdeyunke.com
* +----------------------------------------------------------------------
*/
import request from '@/utils/request'

// 查询定时任务调度列表
export function listJob (query) {
    return request({
        url: '/admin6/job/list',
        method: 'get',
        params: query
    })
}

// 查询定时任务调度详细
export function getJob (job_Id) {
    return request({
        url: '/admin6/job/' + job_Id,
        method: 'get'
    })
}

// 新增定时任务调度
export function addJob (data) {
    return request({
        url: '/admin6/job/add',
        method: 'post',
        data: data
    })
}

// 修改定时任务调度
export function updateJob (data) {
    return request({
        url: '/admin6/job',
        method: 'put',
        data: data
    })
}

// 删除定时任务调度
export function delJob (job_Id) {
    return request({
        url: '/admin6/job/' + job_Id,
        method: 'delete'
    })
}

// 任务状态修改
export function changeJobStatus (job_id, status) {
    const data = {
        job_id,
        status
    }
    return request({
        url: '/admin6/job/changeStatus',
        method: 'put',
        data: data
    })
}


// 定时任务立即执行一次
export function runJob (job_id, job_group) {
    const data = {
        job_id,
        job_group
    }
    return request({
        url: '/admin6/job/run',
        method: 'put',
        data: data
    })
}